//引入定义的常量
import { INCREAMENTCOUNT,DECREAMENTCOUNT } from "../constant/countConsts"
import store from "../store"

//累加的action
export const increamentAction = (data = 1) => {
    return {
        type:INCREAMENTCOUNT,
        data
    }
}

//累减的action 
export const decreamentAction = (data=1)=>{
  return {
    type : DECREAMENTCOUNT,
    data
  }
}

//异步action
export const waitIncreamentAction=(data)=>{
  return ()=>{
    setTimeout(()=>{
     store.dispatch({
      type:INCREAMENTCOUNT,
      data
     })
    },2000)
  }

}